Space-Efficient Blame Tracking for Gradual Types

نویسنده

  • Jeremy G. Siek
چکیده

Static and dynamic type systems have well-known strengths and weaknesses. Gradual typing provides the benefits of both in a single language by giving the programmer control over which portions of the program are statically typed and which portions are dynamically checked based on the presence or absence of type annotations. A compiler for a gradually typed language infers where the dynamic checks are needed and inserts casts into the intermediate language to perform these checks. Herman, Tomb, and Flanagan noticed that casts in higher-order languages can cause space leaks proportional to the execution time of the program. They developed a solution that merges sequences of casts. On a separate front, Findler and Wadler developed blame tracking for a language similar to the intermediate language of gradual typing. Blame tracking solves the problem of tracing a run-time cast failure back to the source of the error. Findler and Wadler proved that well-typed portions of a program can’t be blamed. Blame tracking requires extra information to be stored in casts and whether this information can be merged to obtain space efficiency is an open question. This paper answers the question in the affirmative by developing a dynamic semantics for gradual types that is both space efficient and tracks blame. This paper also improves the precision of blame tracking by reporting what part of the cast caused the error.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Exploring the Design Space of Higher-Order Casts ; CU-CS-1047-08

This paper explores the surprisingly rich design space for the simply typed lambda calculus with casts and a dynamic type. Such a calculus is the target intermediate language of the gradually typed lambda calculus but it is also interesting in its own right. In light of diverse requirements for casts, we develop a modular semantic framework, based on Henglein’s Coercion Calculus, that instantia...

متن کامل

Exploring the Design Space of Higher-Order Casts

This paper explores the surprisingly rich design space for the simply typed lambda calculus with casts and a dynamic type. Such a calculus is the target intermediate language of the gradually typed lambda calculus but it is also interesting in its own right. In light of diverse requirements for casts, we develop a modular semantic framework, based on Henglein’s Coercion Calculus, that instantia...

متن کامل

Gradual Typing with Efficient Object Casts

Gradual type systems meld dynamic typing with optional static types, moderating between the two with statically inserted casts. Casting is the éminence grise of such systems — it enables swift detection of type errors in dynamic code without enforcing runtime checks throughout a program, and in combination with blame tracking it allows such errors to be traced to their origin. However, such cas...

متن کامل

Monotonic References for Efficient Gradual Typing

Gradual typing enables both static and dynamic typing in the same program and makes it convenient to migrate code regions between the two typing disciplines. One goal of gradual typing is to provide all the benefits of static typing, such as efficiency, in statically-typed regions. However, this goal is elusive: the standard approach to mutable references imposes run-time overhead in statically...

متن کامل

A Complement to Blame

Contracts, gradual typing, and hybrid typing all permit less-precisely typed and more-precisely typed code to interact. Blame calculus encompasses these, and guarantees blame safety: blame for type errors always lays with less-precisely typed code. This paper serves as a complement to the literature on blame calculus: it elaborates on motivation, comments on the reception of the work, critiques...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2008